package com.crb.smartcard.cardutils;

import com.crb.smartcard.cardutils.entity.SimCardAndDeviceInfoEntity;
import com.crb.smartcard.core.bean.CardResult;
import com.crb.smartcard.core.oma.SmartCard;
import com.crb.smartcard.utils.LogUtil;

import java.util.ArrayList;
import java.util.List;


/**
 * 获取Sim卡上卡信息
 */
public class GetDefaultCardUtil {
    private static final String TAG = "GetDefaultCardUtil";

    /**
     * 获取Sim卡和Device信息
     */
    public static void getDefaultCard() {
        SimCardAndDeviceInfoEntity simCardAndDeviceInfo = new SimCardAndDeviceInfoEntity();
        //获取iccid
        List<String> cApduList = new ArrayList<>();
        cApduList.add("00A4040009A00000015143525300");
        cApduList.add("80F240000F4F08A0000006320101055C039F704F00");
        List<CardResult> rApduList = new ArrayList<>();
        for (String str : cApduList) {
            CardResult execute = SmartCard.execute(str);
            rApduList.add(execute);
        }
        CardResult cardResult = rApduList.get(rApduList.size() - 1);

        SmartCard.closeChannel();
        LogUtil.e(TAG, cardResult.toString());
    }
}
